SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO





CREATE PROCEDURE [dbo].[usp_AddLectureForVerifiedApplyField]
    (
      @JOL_Lecture_Purpose INT,			--场地用途，即用途为宣讲会的场地申请编号
      @JOL_Lecture_AddUser VARCHAR(50)	--添加账户
    )
AS 
	declare @lectureCount int
	set @lectureCount =
	(
		select count(*) as lectureCount from JOL_Lecture
		where JOL_Lecture_Purpose = @JOL_Lecture_Purpose
	)
	if @lectureCount > 0 return
	else
		INSERT  INTO dbo.JOL_Lecture
				( JOL_Lecture_Purpose ,
				  JOL_Lecture_Title,
				  JOL_Lecture_ClickNumber ,
				  JOL_Lecture_Body,
				  JOL_Lecture_IsSetTop,
				  JOL_Lecture_RequireNumber,
				  JOL_Lecture_RequireStudyLevel,
				  JOL_Lecture_AddTime ,
				  JOL_Lecture_AddUser ,
				  JOL_Lecture_VerifyStatus,
				  JOL_Lecture_IsSendEmail
				)
		VALUES  ( @JOL_Lecture_Purpose ,
				  '',
				  0 , -- JOL_Lecture_ClickNumber - int
				  '',
				  0,
				  0,
				  '本科',
				  GETDATE() , -- JOL_Lecture_AddTime - datetime
				  @JOL_Lecture_AddUser , -- JOL_Lecture_AddUser - varchar(50)
				  '未审核',
				  0-- JOL_Lecture_IsSendEmail - bit
				)



GO
